package com.xwltz.service.impl;

import com.xwltz.entity.Student;
import com.xwltz.repository.StudentRepository;
import com.xwltz.service.StudentService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    private final StudentRepository repository;

    public StudentServiceImpl(StudentRepository repository) {
        this.repository = repository;
    }

    @Override
    public List<Student> findAll() {
        return repository.findAll();
    }

    @Override
    public Student findById(long id) {
        return repository.findById(id).get();
    }
}
